//跨组件通信演示 - 显示内容
import { useContext } from "react";
import { AppContext } from "./appContext";
const App: React.FC = () => {
  //拿到需要的状态和方法
  const { isActive } = useContext(AppContext);
  return (
    <>
      <div
        style={{ backgroundColor: isActive ? "blue" : "gray", color: "white" }}
      >
        简简单单的晚饭
      </div>
    </>
  );
};
export default App;
